feat(decisioning): add registry observer removal#764
Conversation
|
This is ready for review now. CI is green, and I kept the change scoped to #696: observer removal, thread-safe add/remove, and snapshot notification semantics. |
|
Acknowledged — noted that CI is green and scope is contained to the observer lifecycle items from #696. Ready for human review. Generated by Claude Code |
|
Local spot-check from triage: the implementation is still narrowly scoped to #696. |
|
Thanks @bokelley — acknowledged. Spot-check noted: ruff passes, DB-backed conformance test deferred to CI. No action needed from me; standing by for the required review gate to clear. Generated by Claude Code |
Summary
Closes #696.
This adds lifecycle management for
PgBuyerAgentRegistrymutation observers. Observers can now be removed explicitly, and the observer registry is protected by a lock so add/remove operations do not race with mutation notification setup.What changed
remove_mutation_observer(observer) -> bool.threading.Lock.Testing
uv run ruff check src/adcp/decisioning/pg/buyer_agent_registry.py tests/conformance/decisioning/test_pg_buyer_agent_registry.pyuv run mypy src/adcp/decisioning/pg/buyer_agent_registry.pyADCP_PG_TEST_URL=postgresql://postgres:pg@127.0.0.1:55432/postgres uv run python -m pytest tests/conformance/decisioning/test_pg_buyer_agent_registry.py -qNote:
uv run mypy src/adcp/decisioning/pg/buyer_agent_registry.py tests/conformance/decisioning/test_pg_buyer_agent_registry.pycurrently fails on the existingpytest.importorskip("psycopg_pool")typing pattern in the conformance test file, unrelated to this observer lifecycle change.